package o;

import android.content.Context;
import android.text.TextUtils;
import com.huawei.appgallery.foundation.card.base.bean.BaseDistCardBean;
import com.huawei.appgallery.foundation.ui.framework.cardframe.bean.BaseDetailResponse;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

public class chl extends cia {
    private BaseRequest ˏ;
    private BaseDetailResponse ॱ;

    public chl(Context context) {
        super(context);
    }

    public BaseDetailResponse ʻ() {
        return this.ॱ;
    }

    public void ˊ(BaseDetailResponse baseDetailResponse) {
        this.ॱ = baseDetailResponse;
    }

    public BaseRequest ʼ() {
        return this.ˏ;
    }

    public void ॱ(BaseRequest o_cvu) {
        this.ˏ = o_cvu;
    }

    public List<CardBean> ˏ(String str, String str2) {
        List<CardBean> ˏ = ˏ();
        List<CardBean> arrayList = new ArrayList();
        Collection arrayList2 = new ArrayList();
        Collection arrayList3 = new ArrayList();
        if (dof.ˋ(str)) {
            return arrayList;
        }
        int i = 0;
        for (CardBean cardBean : ˏ) {
            if (cardBean instanceof BaseDistCardBean) {
                if (str.equals(((BaseDistCardBean) cardBean).ͺˏ()) && str2.equals(cardBean.ॱˉ())) {
                    i = 1;
                } else if (i != 0) {
                    if (arrayList3.size() == 10) {
                        break;
                    } else if (cardBean.ॱㆍ()) {
                        arrayList3.add(cardBean);
                        break;
                    } else {
                        arrayList3.add(cardBean);
                    }
                } else {
                    arrayList2.add(cardBean);
                    if (arrayList2.size() > 10) {
                        arrayList2.remove(0);
                    }
                    if (cardBean.ॱㆍ()) {
                        arrayList.clear();
                    }
                }
            }
        }
        arrayList.addAll(arrayList2);
        arrayList.add(new BaseDistCardBean());
        arrayList.addAll(arrayList3);
        return arrayList;
    }

    private List<CardBean> ˏ() {
        List<CardBean> arrayList = new ArrayList();
        if (ʻॱ() != null) {
            for (chz o_chz : ʻॱ()) {
                if (ˎ(o_chz, djh.ˋ())) {
                    arrayList.addAll(o_chz.ˎ);
                }
            }
        }
        return arrayList;
    }

    private boolean ˎ(chz o_chz, List<String> list) {
        for (String str : list) {
            if (!TextUtils.isEmpty(o_chz.ˏॱ()) && o_chz.ˏॱ().equals(str)) {
                return true;
            }
        }
        return false;
    }

    public void ॱॱ() {
        super.ॱॱ();
        this.ॱ = null;
        this.ˏ = null;
    }
}
